
package com.uuah.server.api.session;

import java.io.Serializable;
import java.util.Iterator;

import com.uuah.server.api.IUuahEvent;
import com.uuah.server.api.IUuahMessage;
import com.uuah.server.api.component.service.IService;
import com.uuah.server.api.endpoint.IUuahEndpoint;
import com.uuah.server.exception.AbstractUuahServerException;

/**
 *  <code>UuahSession</code> is the context in which a request is executed. The
 * session manages the marshalling of events to and from components This object
 * is not usually referenced by client code directly. If needed Components
 * should manage events via the <code>UuahEventContext</code> which is obtainable
 * via the <code>UMOManager</code> or by implementing
 * <code>com.uuah.server.api.lifecycle.Callable</code>.
 *
 * <p>update record:updator，update time，update content and version</p>
 * @author <a href="jonny_quan@hotmail.com">jonny</a>
 * @date 2009 2009-3-27 上午12:07:46
 * @version 1.0.0
 */
public interface IUuahSession extends Serializable {
	IService getService();

	IUuahMessage sendEvent(IUuahMessage message) throws AbstractUuahServerException;

	IUuahMessage sendEvent(IUuahEvent event) throws AbstractUuahServerException;

	void dispatchEvent(IUuahMessage message) throws AbstractUuahServerException;

	void dispatchEvent(IUuahEvent event) throws AbstractUuahServerException;

	void dispatchEvent(IUuahMessage message, IUuahEndpoint endpoint)
			throws AbstractUuahServerException;

	void dispatchEvent(IUuahMessage message, String endpointName)
			throws AbstractUuahServerException;

	String getId();

	void setProperty(Object key, Object value);

	Object getProperty(Object key);

	Object removeProperty(Object key);

	Iterator getPropertyNames();
}
